package org.rency.mq.activemq.listener.failover.impl;

import org.rency.mq.activemq.jms.service.JmsAccessor;
import org.rency.mq.activemq.listener.failover.RetryExecutor;
import org.rency.mq.activemq.request.MQRequest;

public class ActiveMQRetryExecutor implements RetryExecutor {
	private JmsAccessor mqAccessor;
	
	public ActiveMQRetryExecutor(JmsAccessor mqAccessor){
		this.mqAccessor = mqAccessor;
	}

	public JmsAccessor getMqAccessor() {
		return mqAccessor;
	}

	public void retrySend(MQRequest request) throws Exception {
		getMqAccessor().sendMessage(request.getDestination(),
				request.getDestinationType(), request.getMessageFormat(),
				request.isTransacted(), request.getAcknowledgeMode(),
				request.getDeliveryMode(), request);
	}

}
